<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home extends CI_Controller {
	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
    public function __construct(){
        parent::__construct();
        $this->load->model('Home_model','Home');
        $this->load->model('Product_model','Product');
        $this->load->model('News_model','news');
    }
	public function index()
	{
	    $this->_utility();
		$article=$this->Home->getarticle('4,5,6');				
		$this->MySmarty->assign('about',$article[0]['detail']);
		$this->MySmarty->assign('service',$article[1]['detail']);
		$this->MySmarty->assign('contact',$article[2]['detail']);
        $in_cache_name="home";
        $this->MySmarty->display("home.html",$in_cache_name,$this->Config['DefaultTitle'],$this->Config['DefaultKeywords'],$this->Config['DefaultDescription'],'home');
	}
	public function about(){
		$this->_utility("关于我们  ");
		$article=$this->Home->getarticle("1");		
		$this->MySmarty->assign('tab_bg',"about");
		$this->MySmarty->assign('tab_title',"关于我们");
		$this->MySmarty->assign('content',$article[0]['detail']);
        $this->MySmarty->display("about.html",md5("aboutus"),$this->Config['DefaultTitle'],$this->Config['DefaultKeywords'],$this->Config['DefaultDescription']);

    }
	public function contact(){
		$this->_utility("联系我们  ");
		$article=$this->Home->getarticle("2");
		$this->MySmarty->assign('tab_bg',"contact");
		$this->MySmarty->assign('tab_title',"联系我们");
		$this->MySmarty->assign('content',$article[0]['detail']);
        $this->MySmarty->display("about.html",md5("contact"),$this->Config['DefaultTitle'],$this->Config['DefaultKeywords'],$this->Config['DefaultDescription']);

    }
	function _utility($tltle=""){

	}
	

}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */